package com.modouyu.demo611.demo611.domain;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * @Auther: modouyu
 * @Date: 2018/7/14 08:08
 * @Description:
 * @Email: yangcb@daochunfin.com
 */
public interface UserRepository extends JpaRepository<User,Long> {

    User findByName(String name);
    User findByNameAndAge(String name, Integer age);

    @Query("from User u where u.name=:name")
    User findUser(@Param("name") String name);

}
